<include file="Public:header" />
<include file="Public:left" />
<style>
    td{text-align:center;}
</style>
<section>
    <div class="page_title">
        <h2 class="fl">会员统计</h2>
        <form action="" >
            <input type="text" class="page_title_input" name="keyword" placeholder="可搜索名称" value="{$keyword?$keyword:'';}">
            关键字
            <select name="is_display">
                <option value="">全部状态</option>
                <option value="0" <if condition="$is_display eq '0'">selected</if> >未发布</option>
                <option value="1" <if condition="$is_display eq '1'">selected</if> >发布</option>
            </select>

            <input  class="page_title_submit" type="submit" value="搜索">
        </form>
        <a class="fr" href="{:url('Policy/add')}">添加政策文件</a>
    </div>
    <table class="table">
        <tr>
            <th style="width: 50px;">ID</th>
            <th>文件名</th>
            <th>发文部门</th>
            <th>所属国家/地区</th>
            <th>文件文号</th>
            <th>生效时间</th>
            <th>有效期</th>
            <th>过期时间</th>
            <!--<th>创建时间</th>-->
            <th>是否发布</th>
            <th>申报</th>
            <th style="width:150px;">操作</th>
        </tr>
        <volist name="data" id="vo">
        <tr>
            <td>{$vo.id}</td>
            <td>{$vo.title}</td>
            <td>{$vo.department}</td>
            <td>{$vo.state}&nbsp;{$vo.area}</td>
            <td>{$vo.file_num}</td>
            <td>{$vo.take_time|date="Y-m-d",###}</td>
            <td>{$vo.add_content}</td>
            <td>{$vo.over_time|date="Y-m-d",###}</td>
            <!--<td>{$vo.create_time}</td>-->
            <td>
                <if condition="$vo.is_display eq 0">不发布
                    <else />发布
                </if>
            </td>
            <td>
                <if condition="$vo.status eq 0">审报中
                    <else />审报通过
                </if>
            </td>
            <td>
                <a href="{:url('Policy/edit',array('id'=>$vo.id))}" class="inner_btn">编辑</a>
                <a href="javascript:void(0)" id="{$vo.id}"  class="inner_btn policy_del" >删除</a>
            </td>
        </tr>
        </volist>
    </table>

    {$data->render()}
</section>
<!--tabStyle-->
<script>
    //    删除
    $('.policy_del').click(function(){
        var id = $(this).attr('id');
//        alert(id)
        layer.confirm('删除数据无法恢复，并且会影响用户数据，确定删除？', {
            btn: ['确定', '取消']
        }, function() {
            $.post("{:url('policy/delete')}", {id: id}, function (result) {
//console.log(result.msg);
                if (result.code == '0') {
                    layer.alert(result.msg);
                } else {
                    layer.alert(result.msg, {
                                btn: ['确定']
                            },
                            function (index, item) {
                                //layer.close(index);
                                location.reload();
                            });
                }
            });
        });
    });
</script>
</div>
</section>
</body>
</html>
